package com.personal.summaryofproject.exception;

import com.personal.summaryofproject.enums.BaseExceptionCode;
import lombok.Data;

/**
 * description: BaseException <br>
 * date: 2020/4/18 20:37 <br>
 * author: wenjun.dai <br>
 * version: 1.0 <br>
 */
@Data
public class BaseException extends RuntimeException {

    private Long errCode;

    private String errMsg;

    public BaseException(String errMsg) {
        this(BaseExceptionCode.FAIL.getErrCode(), errMsg);
    }

    public BaseException(BaseExceptionCode msCloudPlugBaseCode) {
        this(msCloudPlugBaseCode.getErrCode(), msCloudPlugBaseCode.getErrMsg());
    }

    public BaseException(Long errCode, String errMsg) {
        super(errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

}